/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_process_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterProcessDetail.findAll", query = "SELECT p FROM PosMasterProcessDetail p"),
//    @NamedQuery(name = "PosMasterProcessDetail.findBySync", query = "SELECT p FROM PosMasterProcessDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterProcessDetail.findByProcessDetailId", query = "SELECT p FROM PosMasterProcessDetail p WHERE p.processDetailId = :processDetailId"),
//    @NamedQuery(name = "PosMasterProcessDetail.findByProcessDetailQuantity", query = "SELECT p FROM PosMasterProcessDetail p WHERE p.processDetailQuantity = :processDetailQuantity"),
//    @NamedQuery(name = "PosMasterProcessDetail.findByProcessDetailPrice", query = "SELECT p FROM PosMasterProcessDetail p WHERE p.processDetailPrice = :processDetailPrice"),
//    @NamedQuery(name = "PosMasterProcessDetail.findByProcessDetailTotal", query = "SELECT p FROM PosMasterProcessDetail p WHERE p.processDetailTotal = :processDetailTotal")})
public class PosMasterProcessDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "process_detail_id")
    private Integer processDetailId;
    @Column(name = "process_detail_quantity")
    private BigDecimal processDetailQuantity;
    @Column(name = "process_detail_price")
    private BigDecimal processDetailPrice;
    @Column(name = "process_detail_total")
    private BigDecimal processDetailTotal;
    @JoinColumn(name = "process_detail_process_id", referencedColumnName = "process_id")
    @ManyToOne
    private PosMasterProcess processDetailProcessId;
    @JoinColumn(name = "process_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private PosMasterItem processDetailItemId;

    public PosMasterProcessDetail() {
    }

    public PosMasterProcessDetail(Integer processDetailId) {
        this.processDetailId = processDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getProcessDetailId() {
        return processDetailId;
    }

    public void setProcessDetailId(Integer processDetailId) {
        this.processDetailId = processDetailId;
    }

    public BigDecimal getProcessDetailQuantity() {
        return processDetailQuantity;
    }

    public void setProcessDetailQuantity(BigDecimal processDetailQuantity) {
        this.processDetailQuantity = processDetailQuantity;
    }

    public BigDecimal getProcessDetailPrice() {
        return processDetailPrice;
    }

    public void setProcessDetailPrice(BigDecimal processDetailPrice) {
        this.processDetailPrice = processDetailPrice;
    }

    public BigDecimal getProcessDetailTotal() {
        return processDetailTotal;
    }

    public void setProcessDetailTotal(BigDecimal processDetailTotal) {
        this.processDetailTotal = processDetailTotal;
    }

    public PosMasterProcess getProcessDetailProcessId() {
        return processDetailProcessId;
    }

    public void setProcessDetailProcessId(PosMasterProcess processDetailProcessId) {
        this.processDetailProcessId = processDetailProcessId;
    }

    public PosMasterItem getProcessDetailItemId() {
        return processDetailItemId;
    }

    public void setProcessDetailItemId(PosMasterItem processDetailItemId) {
        this.processDetailItemId = processDetailItemId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (processDetailId != null ? processDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterProcessDetail)) {
            return false;
        }
        PosMasterProcessDetail other = (PosMasterProcessDetail) object;
        if ((this.processDetailId == null && other.processDetailId != null) || (this.processDetailId != null && !this.processDetailId.equals(other.processDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosMasterProcessDetail[ processDetailId=" + processDetailId + " ]";
    }
    
}
